home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PBLIB1
/
PROGS
/
PATCHFIL.DOC
< prev
next >
Wrap
Text File
|
1994-05-02
|
1KB
|
30 lines
PATCHFIL - Program to make substitution type changes to text files
>PATCHFIL <textfile1> cmdfile=<cmdfile>
<cmdfile> contains one or more string substitutions like:
[ain't]/[isn't]
[cat]/[DOG]
[quick brown fox]/[small blue squirrel]
one per line, square brackets around the strings
<textfile1> is renamed <textfile1>.bak (purging the bak file if it
already exists. The file is then copied line by line with the whole
group of change strings being applied as needed. -- Be careful of
recursive changes like [cat]/[cats] which won't do what you want.
PATCHFIL.CFG (or the cmd line) can have some option controls:
BOTH=YES/NO {def YES} means match upper or lower case or mixed
ALL=YES/NO {def YES} means apply each change as many times as possible
to each line.
?SECTION NOTES
This program is NOT elegant or particularly fast, but it seems to work
well as I migrate libraries with major name changes in them. I use
batch files to apply the changes to many files in sequence. For safety,
I work on a new directory, copying the original file then applying
the changes and re-compiling to check.
Other than the recursive change difficulty, I have not encountered
any problems.